import pygame as pg
import math

pg.init()

window = pg.display.set_mode((500, 500))
window.fill((255, 255, 255))

# 画线
# line(surface，线的颜色，线的起点，线的终点，线宽=1)
pg.draw.line(window, (255, 0, 0), (100, 100), (200, 300))
# 画折线
# lines(surface, 线的颜色，是否闭合，多个点的集合，线宽=1)
points = [(100, 100), (300, 300), (100, 300), (300, 100)]
pg.draw.lines(window, (0, 0, 255), True, points)
# 画圆
# circle(surface，线的颜色，圆心坐标，半径，线宽)
pg.draw.circle(window, (0,255,0), (100, 400), 50, 1)
# 画矩形
# rect(surface, 线的颜色，矩形范围（左上角坐标X, Y ，W，H）， 线宽=0)
pg.draw.rect(window, (100,20,89), (80, 200, 100, 120), 3)
# 画椭圆
# ellipse(surface, 线的颜色，矩形范围，线宽=0)
pg.draw.ellipse(window, (88,88,88), (80, 200, 100, 120), 3)
# 画弧线
# arc(surface，线的颜色，矩形范围，起始弧度，终止弧度，线宽=1)
pg.draw.arc(window, (66,180,90), (80, 200, 100, 120), 2*math.pi, math.pi, 10)

pg.display.flip()
while True:
    for event in pg.event.get():
        if event.type == pg.QUIT:
            exit()
